import Vue from 'vue'
import VueRouter from 'vue-router'
import HomePage from '../components/HomePage.vue'
import ShouYe from '../views/HomeTop/ShouYe.vue'
import Common from '../views/HomeTop/Common.vue'
import AllGoods from '../views/HomeTop/AllGoods.vue'
import SearchGoods from '../views/HomeTop/SearchGoods.vue'
import NewDrug from '../views/HomeTop/NewDrug.vue'
import Slow from '../views/HomeTop/Slow.vue'

import ChangBei from '../views/HomeLeft/ChangBei.vue'
import BaoJian from '../views/HomeLeft/BaoJian.vue'
import YangSheng from '../views/HomeLeft/YangSheng.vue'
import QiXie from '../views/HomeLeft/QiXie.vue'

import Login from '../components/Logins/Login.vue'
import Register from '../components/Logins/Register.vue'
import NotFound from '../components/NotFound.vue'

import Personal from '../components/Personal.vue'

import MyShouCang from '../views/PLeft/MyShouCang.vue'
import My from '../views/PLeft/My.vue'
import GouWuChe from '../views/PLeft/GouWuChe.vue'
import Order from '../views/PLeft/Order.vue'

import shipping_address from '../views/My/shipping_address.vue'
import about from '../views/My/about.vue'
import bill from '../views/My/bill.vue'
import notice from '../views/My/notice.vue'
import privacy from '../views/My/privacy.vue'
import account_security from '../views/My/account_security.vue'

import Middle from '../components/HomePage/Middle.vue'
import Right from '../components/HomePage/Right.vue'
Vue.use(VueRouter)


const routes = [
    {
        path: '/HomePage/:username',
        name: 'HomePage',
        component: HomePage,
        props: true,
        children: [
            {
                path: '/views/AllGoods/:username/:allgoods',
                name: 'AllGoods',
                component: AllGoods,
                props: true,
            },
            {
                path: '/views/SearchGoods/:username',
                name: 'SearchGoods',
                component: SearchGoods,
                props: true,
            },
            {
                path: '/views/AllGoods/:username/',
                name: 'AllGoods',
                component: AllGoods,
                props: true,
            },
            {
                path: '/views/ShouYe/:username/:ShouYe',
                name: 'ShouYe',
                component: ShouYe,
                props: true
            },
            {
                path: '/views/NewDrug/:username/:newdrug',
                name: 'NewDrug',
                component: NewDrug,
                props: true
            },
            {
                path: '/views/Slow/:username/:slow',
                name: 'Slow',
                component: Slow,
                props: true
            },
            {
                path: '/views/Common/:username/:common',
                name: 'Common',
                component: Common,
                props: true
            },
            {
                path: '/views/ChangBei/:username/:changbei',
                name: 'ChangBei',
                component: ChangBei,
                props: true
            },
            {
                path: '/views/BaoJian/:username/:baojian',
                name: 'BaoJian',
                component: BaoJian,
                props: true
            },
            {
                path: '/views/YangSheng/:username/:yangsheng',
                name: 'YangSheng',
                component: YangSheng,
                props: true
            },
            {
                path: '/views/QiXie/:username/:qixie',
                name: 'QiXie',
                component: QiXie,
                props: true
            },
        ]
    },
    {
        path: '/Logins/Login',
        name: 'Login',
        component: Login,
        props: true
    },
    {
        path: '/Logins/Register',
        name: 'Register',
        component: Register,
        props: true
    },
    {
        path: '*',
        name: 'NotFound',
        component: NotFound,
        props: true
    },
    {
        path: '/Personal/:username',
        name: 'Personal',
        component: Personal,
        props:true,
        children: [{
            path: '/MyShouCang/:username/:myshoucang',
            name: 'MyShouCang',
            component: MyShouCang,
            props: true
        },
            {
                path: '/My/:username/:my',
                name: 'My',
                component: My,
                props: true
            },
            {
                path: '/GouWuChe/:username/:gouwuche',
                name: 'GouWuChe',
                component: GouWuChe,
                props: true
            },
            {
                path: '/Order/:username/:order',
                name: 'Order',
                component: Order,
                props: true
            },
            {
                path: '/shipping_address/:username',
                name: 'shipping_address',
                component: shipping_address,
                props: true
            },
            {
                path: '/about',
                name: 'about',
                component: about,
                props: true
            },
            {
                path: '/bill',
                name: 'bill',
                component: bill,
                props: true
            },
            {
                path: '/notice',
                name: 'notice',
                component: notice,
                props: true
            },
            {
                path: '/privacy',
                name: 'privacy',
                component: privacy,
                props: true
            },
            {
                path: '/account_security',
                name: 'account_security',
                component: account_security,
                props: true
            }
        ]
    }
]

const router = new VueRouter({
    routes,
    // 去掉#号
    mode: 'history'
})

export default router
